package com.zhenfan.pattern.serialize;

import java.io.Serializable;

/**
 * 序列化
 *
 * @author wangmh
 * @create 2018-10-31 11:51
 **/
public class Serialize implements Serializable {

    private static Serialize INSTANCE = new Serialize();

    private Serialize() {}

    /**
     * 一个约定，能保证反序列化的是同一个对象
     * @return
     */
    public Object readResolve() { return INSTANCE; }

    public static Serialize getInstance() {
        return INSTANCE;
    }
}
